package com.yusys.ba02;

import org.springframework.stereotype.Component;

/**
 * @Component ：创建对象的，等同与<bean></bean>的功能
 *      属性：value 就是对象名称，也就是bean的id值
 *           value的值是唯一的
 */
@Component(value = "myStudent")
public class Student {

    private String name;
    private Integer age;

    public Student() {
        System.out.println("==调用无参构造对象==");
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
